// 引入字体图标
require('../assets/fonts/iconfont.css')

function renderTabbar(){
    console.log(location.pathname);
    let arr=[
        {
            path: './home.html',
            title: '首页',
            icon: 'icon-shouye',
        },
        {
            path: './run.html',
            title: '运动',
            icon: 'icon-aixin',
        },
        {
            path: './circle.html',
            title: '圈子',
            icon: 'icon-wode-',
        },
        {
            path: './mine.html',
            title: '我的',
            icon: 'icon-quanzi',
        },
    ]
    let html=`
    ${arr.map((v,i)=>{
        return `
        <a href="${v.path}" class="${
            v.path === '.' + location.pathname && 'active'
          }">
        <span class="iconfont ${v.icon} "></span>
        <p class="">${v.title}</p>
      </a>
        `
    }).join('')
}
    

     
  
    
    `
    // 创建一个div
    let div=document.createElement('div')
    div.className='foot'
    div.innerHTML=html
    document.body.appendChild(div)
}
module.exports=renderTabbar